Route every lazy keym-v2 and Shamir import through its typed loader - #212
Merged
Merged
Conversation
Finding 6 typed the module-load failure in keymaker-crypto.ts and in addShamirSlotKeym2. Twenty-one other sites still used a bare import(): 16 of keym-v2 and 1 of keym-v2-shamir in encryptor-tool.tsx, and 2 each of keym-v2 in crypto-client.ts (the no-worker fallback) and crypto-worker.ts. None can fail today. The page imports keym-v2 statically, the fallback's imports run after encryptContainer has loaded it, and the worker is one IIFE bundle. Each would bring back the untyped "wrong password" failure if that stopped being true. - loadKeym2 (keymaker-crypto.ts) and loadShamir (keym-v2.ts) are exported and all 21 sites use them. - secret-erase-core-test.mjs scans src and fails on any bare import() of either module outside the two loaders, and checks its own pattern against the forms it guards and a type-only import(). No call can model the failure while the static import is there, so the guard is a source check. Controls, each type-checked: one bare import back in crypto-client.ts fails with 1 offender; the bare Shamir import back in the page fails with 1; the three files as they were fail with 21.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-targets the change from #211 at
main. #211 was based on #210's branch and closed after #210 merged, somainnever received it:loadKeym2inkeymaker-crypto.tsis still unexported there and 21 lazy imports still bypass the typed loaders.What changes
Finding 6 typed the module-load failure in
keymaker-crypto.tsand inaddShamirSlotKeym2. Twenty-one other sites still used a bareimport(): 16 ofkeym-v2and 1 ofkeym-v2-shamirinencryptor-tool.tsx, and 2 each ofkeym-v2incrypto-client.ts(the no-worker fallback) andcrypto-worker.ts.None can fail today. The page imports
keym-v2statically, the fallback's imports run afterencryptContainerhas loaded it, and the worker is one IIFE bundle. Each would bring back the untyped "wrong password" failure if that stopped being true.loadKeym2(keymaker-crypto.ts) andloadShamir(keym-v2.ts) are exported and all 21 sites use them.secret-erase-core-test.mjsscanssrcand fails on any bareimport()of either module outside the two loaders, and checks its own pattern against the forms it guards and a type-onlyimport().Why a source scan
No call can model the failure while the static import is there, so the guard is a source check rather than a runtime test.
Negative controls, each type-checked
crypto-client.ts: fails with 1 offender.Diff
7 files, +79 / -26. Merges cleanly into
mainat2aa0b4b.Generated by Claude Code